version 1.0 
#WORKFLOW DEFINITION
workflow CdhitFlow {
    input {
        File fasta
        String sample_name
        String gotc_docker = "nanozoo/cdhit:latest"
    }

    call CdhitTask {
        input:
            fasta = fasta,
            sample_name = sample_name,
            docker_image = gotc_docker
    }
    output {
        File outputfasta = CdhitTask.outputfasta
    }
}

#Task Definitions
task CdhitTask{
    input{
        #Command parameters
        File fasta
        String sample_name

        Int machine_mem_size 
        Int disk_size
        String docker_image
    }

    command {
        cd-hit -i ~{fasta} -o ~{sample_name}.fasta -c 0.9 -n 5 -d 0 -M 0
    }

    runtime {
        docker: docker_image
        memory: machine_mem_size + " GB"
        disk: disk_size + " GB"
    }

    output {
     File outputfasta = "~{sample_name}.fasta"
    }
}

